UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fzXRqQIeQIIq8UgWGRDVzLMHk0BQM1I5e3ks7Gv67uA=' 
WHERE 
  key_id = 'c7db4490a4c2942d227892a183f0fcec3d16948eda3ae3d6ef7c9a0f8fb224c4' 
  AND (
    token = 'fzXRqQIeQIIq8UgWGRDVzLMHk0BQM1I5e3ks7Gv67uA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00198