UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+GTwisZMWATUp0R46GpkZm/x1d79XKobKh1BFYzx2vI=' 
WHERE 
  key_id = 'deba9966f1ddf3785943628369571cf51bd5de463cf14fa5404346baf9d1bfad' 
  AND (
    token = '+GTwisZMWATUp0R46GpkZm/x1d79XKobKh1BFYzx2vI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029