UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A/ufV7xXbQAbD2QFCB1D/ZBTCbIx0rjne6tmQKfsLsE=' 
WHERE 
  key_id = 'ffa5fcc124a71f0e396afb93c5bba5fb4c34cb6cbdbf3382483b0f9076ab04db' 
  AND (
    token = 'A/ufV7xXbQAbD2QFCB1D/ZBTCbIx0rjne6tmQKfsLsE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020