UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'njyuyoxhnW1x3o5sp3+6BLidCM0VIDAoXNXrMcvohC8=' 
WHERE 
  key_id = '3b14dc8b367a9922edf61dd6bbe9ed780811ad22c1e7650bb3886032b038d162' 
  AND (
    token = 'njyuyoxhnW1x3o5sp3+6BLidCM0VIDAoXNXrMcvohC8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029