UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8s2sPxXbHhXj4a79DVm4qlo8FVSHlO1QK4v1wTMa1jw=' 
WHERE 
  key_id = '1438299b7110d8cb0d9da7da7cd5251095765cb7f63947d516a37a55f73dc2ff' 
  AND (
    token = '8s2sPxXbHhXj4a79DVm4qlo8FVSHlO1QK4v1wTMa1jw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022