UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w4dNMDN3kBhwNQ8Y4+asMeYtWAOaMgZhryRgyV3W6tg=' 
WHERE 
  key_id = '10ea3312f7b28e59671d9ea5654db849aeb86cea217862b0eb5a50c130ffa4fb' 
  AND (
    token = 'w4dNMDN3kBhwNQ8Y4+asMeYtWAOaMgZhryRgyV3W6tg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035