UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3+7Qk9qrXdGOkEsXJszc44CoT7083PrgBe2exwrrbus=' 
WHERE 
  key_id = 'df5fa140bc7027374c987d96d7d24a6d3dc263b5d5666593bb3aa4f623ec430c' 
  AND (
    token = '3+7Qk9qrXdGOkEsXJszc44CoT7083PrgBe2exwrrbus=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029