UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+9KOg8xnXyHXuLtX8F1EfL5+ZgQFlzTRYP4oXPTMroY=' 
WHERE 
  key_id = '75c1f7e4b248b920fe2d8a07c25fb2fabcce372175372191bdd7c14ece2149d2' 
  AND (
    token = '+9KOg8xnXyHXuLtX8F1EfL5+ZgQFlzTRYP4oXPTMroY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015