UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LSmJz7mRWczErCVm3Std2eXd2kXJ1M7tJU+SAhsZjeM=' 
WHERE 
  key_id = '4ff7580b33f4dae5af4a6426fb0821db6fbca69365e3c0e0629abd72d9cd27f3' 
  AND (
    token = 'LSmJz7mRWczErCVm3Std2eXd2kXJ1M7tJU+SAhsZjeM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044