UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WXCo3blbjYl5LxmT56FeSWvWEEMNx/FfC5JDLrUKzLU=' 
WHERE 
  key_id = '40d114f2ba12a617d9db9a37d623cd7096318710db1e5d7e5263b5418e4ae086' 
  AND (
    token = 'WXCo3blbjYl5LxmT56FeSWvWEEMNx/FfC5JDLrUKzLU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036