UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IaCwP5/coKmxh0fWUXwsjk6aUb/fZaNxLo6aHBONHF0=' 
WHERE 
  key_id = 'fc89d13728c079d49562fd5c16de4e8d3136c9c1725e4ba3a03028fb7edc41f5' 
  AND (
    token = 'IaCwP5/coKmxh0fWUXwsjk6aUb/fZaNxLo6aHBONHF0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028