UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mMxPKlwT/bnVKYiT6YnuxAAA+3bTJyZgkM78flSBU/M=' 
WHERE 
  key_id = '3b8ea635c8a6c1a65ace17344b7edb1c5540237ef1bfa5a8de2012cba0c2c41b' 
  AND (
    token = 'mMxPKlwT/bnVKYiT6YnuxAAA+3bTJyZgkM78flSBU/M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026