UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9C0cvGpIwwoyTx0I3LatCQmOV0bYChFaoOo283WPZLY=' 
WHERE 
  key_id = '7de6fa42c928c81c3aec40f1779fc34fc74f8dab7895c827161dbe694df81b6b' 
  AND (
    token = '9C0cvGpIwwoyTx0I3LatCQmOV0bYChFaoOo283WPZLY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )