UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Sb0UlDtjfKTgoNhmoU+RGmoeZKnSGmWWuyFqALGNNeM=' 
WHERE 
  key_id = 'ad129a26fac09bfa1e497f3df03bb8681c4a61f263ff85e4b4261275f669f9fd' 
  AND (
    token = 'Sb0UlDtjfKTgoNhmoU+RGmoeZKnSGmWWuyFqALGNNeM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025