UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4euyLX6vE6Ozna/lnuPwjsqisdINqCvsqQn5sGWpebM=' 
WHERE 
  key_id = '72bd1e8198b033d3516a5d664cb3ba717d88ad35c686377b0c432057ea520119' 
  AND (
    token = '4euyLX6vE6Ozna/lnuPwjsqisdINqCvsqQn5sGWpebM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030