UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nWZT6qmvnKtf69H+m5eqM8HlX5WA+m7bswbhGJUHzUA=' 
WHERE 
  key_id = 'db25b3f3da2785e02b7e21a4bbe56e3f14892ae8ea86cbfb5b595eff4419773d' 
  AND (
    token = 'nWZT6qmvnKtf69H+m5eqM8HlX5WA+m7bswbhGJUHzUA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019