UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3S91FWrCpr+QlrbTKvbOCwubPkRW8gvr9KSbwPyrDKE=' 
WHERE 
  key_id = '10a9c20c0e488cd268bf00e59f9d6ae348c8ffaf29e903aec78f03f22e9fbf33' 
  AND (
    token = '3S91FWrCpr+QlrbTKvbOCwubPkRW8gvr9KSbwPyrDKE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027