UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dimdfVVJKGtu6DrPEUIHW8k3qcJXrJMh4CT/6a1jPiA=' 
WHERE 
  key_id = 'f7e374152fd4973e060429a55f6c97c4e7d6976110aff0d25474d35ca472f6ea' 
  AND (
    token = 'dimdfVVJKGtu6DrPEUIHW8k3qcJXrJMh4CT/6a1jPiA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038