UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yGuXLuIjqnGjoZ+QfGCyDryPuocBu2dAjutJ2f27MOs=' 
WHERE 
  key_id = '9ec94b92ec851ca5aa4fc0bd07162bc60c4ed2a468971614882cc3b06cd1a3fb' 
  AND (
    token = 'yGuXLuIjqnGjoZ+QfGCyDryPuocBu2dAjutJ2f27MOs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036