UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yJC5YUFU2vw/Nrgj4a5cnKMCu5wYfTyVG9Ey2rpDFSM=' 
WHERE 
  key_id = '69baa70b5ce52d31c123f2de0192cf854a0f9d9f3b5150be40e081aa3776ee76' 
  AND (
    token = 'yJC5YUFU2vw/Nrgj4a5cnKMCu5wYfTyVG9Ey2rpDFSM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032