UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3+GeEBo1X1dYTREIJiJFFS7hsE9+aUl6Fc8JACkbSpM=' 
WHERE 
  key_id = '61d7df9aecb6301c3b201b7dabf97d69a929f14f2e854e8525f83543ca232225' 
  AND (
    token = '3+GeEBo1X1dYTREIJiJFFS7hsE9+aUl6Fc8JACkbSpM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039