UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZN6Rbar7vm+dFZMp6XnOzNiRJAWHpTIuHYdacWbVsTI=' 
WHERE 
  key_id = 'f880a90e07e75727b9b8d847f5dec7a164e32ba92ce87dab328bc0515a0afbfc' 
  AND (
    token = 'ZN6Rbar7vm+dFZMp6XnOzNiRJAWHpTIuHYdacWbVsTI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020