UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'weNGxaWZnwjuGlyD4dZn8Mc8Sxc/x5zOjl4uz6rWzug=' 
WHERE 
  key_id = '306d2ae152cf85b780804ec705561c306ca15dac9b4e892fbf6d945671b17fa7' 
  AND (
    token = 'weNGxaWZnwjuGlyD4dZn8Mc8Sxc/x5zOjl4uz6rWzug=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041