UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V789vdZbvpRuaLnYn/+xBjNqGOEUMC5t8UvjB9D07eM=' 
WHERE 
  key_id = 'eb200126a41339324fc38ae667bed44e1d0d6368b25e90c23dfefbabfe079e76' 
  AND (
    token = 'V789vdZbvpRuaLnYn/+xBjNqGOEUMC5t8UvjB9D07eM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026