UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aSFG2v4GMSoKrTAIWJcfFsgkdhAwapXwE9zPSKhtBzE=' 
WHERE 
  key_id = '75d88a0d4388cbb84b2073f2142b0486ebe17df4f12a8991c5da8acc6f1da623' 
  AND (
    token = 'aSFG2v4GMSoKrTAIWJcfFsgkdhAwapXwE9zPSKhtBzE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040