UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aAocjyjbOJ5OAWwx2fxs0frex0lprNuT32/SCR8Lp1M=' 
WHERE 
  key_id = '5af39cb1a8a9bc7d2a87b28fa3ff43da611231dd732c7089d0e7c246f63d26fb' 
  AND (
    token = 'aAocjyjbOJ5OAWwx2fxs0frex0lprNuT32/SCR8Lp1M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018