UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ap6Bf1Aa5pyhR/elFGa+fZrAr6xoJbGW543KntZfYPM=' 
WHERE 
  key_id = '080cf65cae28dbe7fba45157a3e285b18cbfdd61289ce5d6ba29923be1bfa301' 
  AND (
    token = 'ap6Bf1Aa5pyhR/elFGa+fZrAr6xoJbGW543KntZfYPM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024