UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1NFcO/LjLZCCwS/Hx9WsZELCCGp0z80ZdMu6p4UpeEI=' 
WHERE 
  key_id = 'ab9eca59cd72b856767cd62471cdfd97ad346c067ebd6cbf1d4cca99e9baf9df' 
  AND (
    token = '1NFcO/LjLZCCwS/Hx9WsZELCCGp0z80ZdMu6p4UpeEI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035