UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fO142UBF6kWKJyMIqkrR2XfDnCRDo0+nyUUVa8oCCQo=' 
WHERE 
  key_id = '665836b5ebc3b946221942ad4fc49ec62ba68a3123c93932bb89424d1c8f44d3' 
  AND (
    token = 'fO142UBF6kWKJyMIqkrR2XfDnCRDo0+nyUUVa8oCCQo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045