UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4AGtwO/bi/J5OvwI4CftPbe8lEhfuN2RvztVoFBBeQU=' 
WHERE 
  key_id = 'a32c188f0f1b5b588760c4da2bb91da21648f3fafad83b1e6bd4e3406074c29b' 
  AND (
    token = '4AGtwO/bi/J5OvwI4CftPbe8lEhfuN2RvztVoFBBeQU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035