UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vjD1lNowhFTzIBD1ohuLfvbNab++wQFp+CVdOWp48dQ=' 
WHERE 
  key_id = '11b0757cfc95e61c25f21831d1d2b41829362def9997c4b63f401b31e1245a0d' 
  AND (
    token = 'vjD1lNowhFTzIBD1ohuLfvbNab++wQFp+CVdOWp48dQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016