UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'O6hsnV33DwvomFRNsYgFu+YkOTlBKYqoi6XUJX3oDMI=' 
WHERE 
  key_id = 'bf21d6086cef625fa897bcbfb7210c3ed913c409f36fb0c54c280e6e910ae177' 
  AND (
    token = 'O6hsnV33DwvomFRNsYgFu+YkOTlBKYqoi6XUJX3oDMI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064