UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3FfUhqbzERGYMUFNWareTWJO36aY/OMSPB6yoL7v7p8=' 
WHERE 
  key_id = '46b1e8066558afe5642c5307737487e05c687ac4990dbc4209dace32131395e3' 
  AND (
    token = '3FfUhqbzERGYMUFNWareTWJO36aY/OMSPB6yoL7v7p8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048