UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qEdrJiskfqraE9he9d3JCmYpKDQ1/IrvZaDBoteKFho=' 
WHERE 
  key_id = '9a4e22bddf8e0ed6d5b32a0444e28de06b9db987bc4c94e2272a70bfd34c6088' 
  AND (
    token = 'qEdrJiskfqraE9he9d3JCmYpKDQ1/IrvZaDBoteKFho=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028