UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5g0I48Bo07LVXCC2h1EprgQAPOpmz4z7kZZIYC9vRcw=' 
WHERE 
  key_id = '2443a3e86d72e6cbc6e715db84286ca51d15670c344bcf1406ff101791b86257' 
  AND (
    token = '5g0I48Bo07LVXCC2h1EprgQAPOpmz4z7kZZIYC9vRcw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036